//
//  SEGSharedCommentChildCommentModel.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/10/19.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGSharedCommentChildCommentModel.h"
#if __has_include(<Commom/YYBaseHeader.h>)
#import <Commom/YYBaseHeader.h>
#else
#import "YYBaseHeader.h"
#endif
@implementation SEGSharedCommentChildCommentModel
- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    if (self) {
//        _comment = [[SEGSharedCommentChildCommentInfoModel alloc] init];
//        _reviewUser = [[SEGSharedCommonUserModel alloc] init];
//        _user = [[SEGSharedCommonUserModel alloc] init];
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString*)key
{
    if ([key isEqualToString:@"comment"]) {
        if ([value isKindOfClass:[NSDictionary class]]) {
            _comment = [SEGSharedCommentChildCommentInfoModel initWithDictionary:value];
        }
        return;
    }
    
    if ([key isEqualToString:@"user"]) {
        if ([value isKindOfClass:[NSDictionary class]]) {
            _user = [SEGSharedCommonUserModel initWithDictionary:value];
        }
        return;
    }

    if ([key isEqualToString:@"reviewUser"]) {
        if ([value isKindOfClass:[NSDictionary class]]) {
            _reviewUser = [SEGSharedCommonUserModel initWithDictionary:value];
        }
        return;
    }
    
    [super setValue:value forKey:key];
}
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}
- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{}

@end
